-
Notifications
You must be signed in to change notification settings - Fork 263
Fix/replace deprecated budget method #1604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix/replace deprecated budget method #1604
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1604 +/- ##
===========================================
- Coverage 93.53% 72.40% -21.13%
===========================================
Files 55 55
Lines 6357 6357
===========================================
- Hits 5946 4603 -1343
- Misses 411 1754 +1343 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @caiquefortunato thank you for the PR. Everything looks good 👍
Let's wait for the test to pass before merge but code looks okay! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I came back from work and see that the current solutions its not enough. Would be great, and we can support you if you need a hand to work on it.
|
||
with pytest.raises(ValueError, match="noise_level must be a float"): | ||
mmm_fitted.allocate_budget_to_maximize_response( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, reading this better. Here we are doing the wrong fix. We should:
- Replace all the suite (not only this test) to work with the new class.
- We need to test the same scenarios, meaning, you need to test
optimize budget
andsample_response_distribution
- No parameters should be delete, the test should be handle differently.
- We need test for the method to be deprecated, and the new one. This because we still will hold the old method for at least one more release. So, best way should be to have test for both, and be sure non of them is doing something funny. IF we don't want to do this then we should deprecated already the old method. @williambdean Whats your take?
Description
This PR updates the test test_allocate_budget_to_maximize_response_bad_noise_level by replacing the usage of the deprecated method allocate_budget_to_maximize_response with the recommended optimize_budget method.
This aligns the codebase with the current API and avoids suppressing DeprecationWarnings, as discussed in issue #1598 and the feedback on PR #1603.
Related Issue
optimize_budget
method instead in tests #1598Checklist
pre-commit.ci autofix
to auto-fix.📚 Documentation preview 📚: https://pymc-marketing--1604.org.readthedocs.build/en/1604/